using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.SYS
{
    [Table("sys_sc_user_roles"), DataContract]
    public class UserRole
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "UserRoleId", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("user_role_seq")]
        public int UserRoleId { get; set; }

        [ForeignKey("User")]
        [DataMember, Display(Name = "UserId", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("user_seq")]
        public int UserId { get; set; }

        [ForeignKey("Position")]
        [DataMember, Display(Name = "PosId", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("pos_seq")]
        public Nullable<int> PosId { get; set; }

        [ForeignKey("Role")]
        [DataMember, Display(Name = "RoleId", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("role_seq")]
        public int RoleId { get; set; }

        [ForeignKey("MasEmployeeType")]
        [DataMember, Display(Name = "EmpTypeId", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("emp_type_seq")]
        public Nullable<int> EmpTypeId { get; set; }

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("record_status")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("created_by")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("created_when")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("updated_by")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.ScUserRolesResource))]
        [Column("updated_when")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        [DataMember]
        public virtual SYS.User User { get; set; }

        [DataMember]
        public virtual HRM.Position Position { get; set; }

        [DataMember]
        public virtual SYS.Role Role { get; set; }

        [DataMember]
        public virtual HRM.MasEmployeeType MasEmployeeType { get; set; }
    }
}
